**************************
*** TAA Responsiveness *** 
**************************

use "kimpelc_czone_t2.dta", clear

drop if year == 2007

*** Table 1 & Panel A 

eststo clear
eststo: ivregress 2sls d_trans_taaimp_pc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls d_cz_TAAdlrs_petit_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls d_cz_TAAdlrs_petit_cert_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls d_cz_TAAdlrs_wrks_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls d_cz_TAAdlrs_wrks_cert_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

esttab using "Table1-A.tex", label keep(d_tradeusch_pw) indicate("Decade FE = t2") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*** Table 1 & Panel B 

eststo clear
eststo: ivregress 2sls l_trans_taaimp_pc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_petit_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_petit_cert_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_wrks_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_wrks_cert_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

esttab using "Table1-B.tex", label keep(l_tradeusch_pw) indicate("Decade FE = t2") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*************************************************************
*** TAA Responsiveness and the 2016 Republican Vote Share *** 
*************************************************************

*** Table 2 

use "kimpelc_election.dta", clear

eststo clear 
eststo: regress rep_share_0016 response, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born reg*, cluster(statefip)

esttab using "Table2.tex", label  keep(response) indicate("2000 Industry/Occupation Controls = l_task_outsource" "Individual Demographics = college_educated" "Region FE =  reg_pacif") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars
